package com.example.bookstore.service;

import com.example.bookstore.entity.BookUser;
import com.example.bookstore.form.userform.LoginForm;
import com.example.bookstore.form.userform.RegisterForm;
import com.example.bookstore.form.userform.ChangePwdForm;
import com.example.bookstore.form.userform.UpdateUserForm;
import com.example.bookstore.vo.ResultVO;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.text.ParseException;

@Service
@Repository
public interface BookUserService {

    /*
    用户注册
    @param RegisterForm
    @return int
     */
    ResultVO UserRegister(RegisterForm registerForm) throws ParseException;

    /*
    用户更改密码
    @param ChangePwdForm
    @return int
     */
    ResultVO UserChangePwd(ChangePwdForm changePwdForm);

    /*
    用户更新信息
    @param UpdateUserForm
    @return int
     */
    ResultVO UpdateUser(UpdateUserForm updateUserForm);

    /*
    用户激活
    @param activityCode,userId
    @return
     */
    ResultVO ActivityUser(String activity,Integer userId);

    /*
    根据用户ID查询用户
    @param userId
    @return BookUser
     */
    ResultVO SelectUserById(Integer userId);

    /*
    根据用户name模糊查询用户
    @param userName
    @return BookUser
     */
    ResultVO SelectUserByName(String userName);

    /*
    根据用户id删除用户
    @param userId
    @return int
     */
    ResultVO DeleteUserById(Integer userId);

    /*
    用户登录
    @param LoginForm
    @return
     */
    ResultVO UserLogin(LoginForm loginForm);

    /*
    测试获取在线用户
    @param null
    @return BookUser
     */
    BookUser getCurrentUser();

    /*
    退出登录
    @param null
    @return
     */
    ResultVO UserLogout();

    /*
    获取所有用户
    @param null
    @return
     */
    ResultVO ShowAllUser();

    /*
    通过用户手机号验证码登录
     */
    ResultVO UserLoginByTel(String telePhone,String code);
}
